
from letter_count import get_word_count,letter_count
import unittest

class TestLetterCount(unittest.TestCase):
#create UT for get_word_count, input "A", output {"A":1}
  def test_get_word_count_1(self):
    self.assertEqual(get_word_count("A"), {"A":1}) 
  def test_get_word_count_2(self):
    self.assertEqual(get_word_count("AA"), {"A":2})
  #input "AA B", output {"A":2, "B":1}
  def test_get_word_count_3(self):
    self.assertEqual(get_word_count("AAB"), {"A":2, "B":1})
  #input "A-2", output {"A":2}
  def test_get_word_count_4(self):
    self.assertEqual(get_word_count("A-2"), {"A":2})
  #input "B:3", output {"B":3}
  def test_get_word_count_5(self):
    self.assertEqual(get_word_count("B:3"), {"B":3})
  #input "E=5", output {"E":5}
  def test_get_word_count_6(self):
    self.assertEqual(get_word_count("E=5"), {"E":5})

#create UT for letter_count, input "A B", output {"A":1, "B":1}
  def test_letter_count_1(self):
    self.assertEqual(letter_count("A B"), {"A":1, "B":1})
  #input "A B2", output {"A":1, "B":2}
  def test_letter_count_2(self):
    self.assertEqual(letter_count("A B2"), {"A":1, "B":2})
  #input "A B2 C:3", output {"A":1, "B":2, "C":3}
  def test_letter_count_3(self):
    self.assertEqual(letter_count("A B2 C:3"), {"A":1, "B":2, "C":3})
  #input "A B2 C:3 D=4", output {"A":1, "B":2, "C":3, "D":4}
  def test_letter_count_4(self):
    self.assertEqual(letter_count("A B2 C:3 D=4"), {"A":1, "B":2, "C":3, "D":4})
  #input "A B2 B", output {"A":1, "B":3}
  def test_letter_count_5(self):
    self.assertEqual(letter_count("A B2 B"), {"A":1, "B":3})

if __name__ == '__main__':
    unittest.main()